﻿<%@ Page Language="C#" MasterPageFile="~/INFTUR.Master" AutoEventWireup="true" CodeBehind="VendaPasagem.aspx.cs" Inherits="INFTUR.VendaPasagem" Title="Untitled Page" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 92px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="principal">
        <div id="consulta">
        &nbsp;<asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="principal">
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" DataSourceID="odVendaPassagem">
                <Columns>
                    <asp:BoundField DataField="Id" HeaderText="Codigo" SortExpression="Id" />
                    <asp:BoundField DataField="CBO" HeaderText="Cliente" SortExpression="CBO" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="lbAtualiza" runat="server" onclick="lbAtualiza_Click">Atualizar</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="lbRemove" runat="server" onclick="lbRemove_Click">Remover</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:ObjectDataSource ID="odVendaPassagem" runat="server" 
                DataObjectTypeName="Negocios.VendaPassagemBO" DeleteMethod="Remove" 
                InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="ConsultaTodos" TypeName="Negocios.VendaPassagemBOMetodos" 
                UpdateMethod="Atualiza">
                <DeleteParameters>
                    <asp:Parameter Name="id" Type="Int32" />
                </DeleteParameters>
            </asp:ObjectDataSource>
            <br />
        <div id="cadastro">
            <table style="width: 57%;">
                <tr>
                    <td class="style1">
                        &nbsp;
                        <asp:Label ID="lbCodigo" runat="server" Text="Codigo"></asp:Label>
                    </td>
                    <td>
                        &nbsp;
                        <asp:TextBox ID="tbCodigo" runat="server"></asp:TextBox>
                        <asp:Button ID="BVenda" runat="server" Text="Vender Passagens" 
                            onclick="BVenda_Click" />
                    </td>
                </tr>
                <tr>
                    <td class="style1">
                        &nbsp;
                        <asp:Label ID="lbCliente" runat="server" Text="Cliente:"></asp:Label>
                    </td>
                    <td>
                        &nbsp;
                        <asp:DropDownList ID="ddCliente" runat="server" DataSourceID="ODCliente" 
                            DataTextField="Nome" DataValueField="Cpf">
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="ODCliente" runat="server" 
                            DataObjectTypeName="Negocios.ClienteBO" DeleteMethod="Remove" 
                            InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                            SelectMethod="ConsultaTodos" TypeName="Negocios.ClienteBOMetodos" 
                            UpdateMethod="Atualiza">
                            <DeleteParameters>
                                <asp:Parameter Name="cpf" Type="String" />
                            </DeleteParameters>
                        </asp:ObjectDataSource>
                    </td>
                </tr>
                <tr>
                    <td class="style1">
                        &nbsp;
                        <asp:Label ID="lbpreco" runat="server" Text="Preço:"></asp:Label>
                    </td>
                    <td>
                        &nbsp;
                        <asp:TextBox ID="tbPreco" runat="server" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style1">
                        &nbsp;
                        <asp:Label ID="lbCompanhia" runat="server" Text="Companhia"></asp:Label>
                    </td>
                    <td>
                        &nbsp;
                        <asp:DropDownList ID="ddCompanhia" runat="server">
                            <asp:ListItem Value="1"></asp:ListItem>
                            <asp:ListItem Value="2"></asp:ListItem>
                            <asp:ListItem Value="3"></asp:ListItem>
                        </asp:DropDownList>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td class="style1">
                        &nbsp;
                        <asp:Label ID="lbDataIda" runat="server" Text="Data da Ida:"></asp:Label>
                    </td>
                    <td>
                        &nbsp;
                        <asp:TextBox ID="tbDataIda" runat="server" style="margin-left: 0px" 
                            Enabled="False"></asp:TextBox>
                        <cc1:CalendarExtender ID="tbDataIda_CalendarExtender" runat="server" 
                            Enabled="False" TargetControlID="tbDataIda">
                        </cc1:CalendarExtender>
                    </td>
                </tr>
                <tr>
                    <td class="style1">
                        &nbsp;
                        <asp:Label ID="lbDataVolta" runat="server" Text="Data da Volta:"></asp:Label>
                    </td>
                    <td>
                        &nbsp;
                        <asp:TextBox ID="tbDataVolta" runat="server" Enabled="False"></asp:TextBox>
                        <cc1:CalendarExtender ID="tbDataVolta_CalendarExtender" runat="server" 
                            Enabled="False" TargetControlID="tbDataVolta">
                        </cc1:CalendarExtender>
                    </td>
                </tr>
                <tr>
                    <td class="style1" id="tb">
                        &nbsp;
                        <asp:Label ID="lbClasse" runat="server" Text="Classe:"></asp:Label>
                    </td>
                    <td>
                        &nbsp;
                        <asp:DropDownList ID="ddClasse" runat="server">
                            <asp:ListItem Value="1"></asp:ListItem>
                            <asp:ListItem Value="2"></asp:ListItem>
                            <asp:ListItem Value="3"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
            </table>
            <center style="width: 423px">
                <asp:Button ID="bGravar" runat="server" onclick="bGravar_Click" 
                    Text="Gravar/Alterar:" />
                <asp:Button ID="bCancelar" runat="server" onclick="bCancelar_Click" 
                    Text="Cancelar" />
            </center>
        </div>
        </div>
        
        </div>
        <asp:Label ID="lErro" runat="server"></asp:Label>
        <br />
    </div>
</asp:Content>
